package com.example.blew.omp.system.util;


import cn.hutool.cache.Cache;
import cn.hutool.cache.impl.CacheObj;
import cn.hutool.core.lang.func.Func0;
import org.springframework.data.redis.core.RedisTemplate;

import java.util.Iterator;

public class RedisCache implements Cache {

    /**
     * spring redis cache,
     */
    private Cache cache;

    private RedisTemplate redisTemplate;

    /**
     * 默认不清除原有缓存
     */
    public RedisCache(Cache cache, RedisTemplate redisTemplate) {
        this(cache, redisTemplate, false);
    }

    /**
     * @param cache         spring cache
     * @param redisTemplate 用于进行缓存的批量操作
     * @param clearExist    是否初始化缓存（清除redis中已经存在的缓存数据）
     */
    public RedisCache(Cache cache, RedisTemplate redisTemplate, boolean clearExist) {
        this.cache = cache;
        this.redisTemplate = redisTemplate;
        // 创建缓存前, 是否初始化缓存，清除原有的
        if (clearExist) {
            cache.clear();
        }
    }




    @Override
    public int capacity() {
        return 0;
    }

    @Override
    public long timeout() {
        return 0;
    }

    @Override
    public void put(Object o, Object o2) {

    }

    @Override
    public void put(Object o, Object o2, long l) {

    }

    @Override
    public Object get(Object o, boolean b, Func0 func0) {
        return null;
    }

    @Override
    public Object get(Object o, boolean b) {
        return null;
    }

    @Override
    public Iterator<CacheObj> cacheObjIterator() {
        return null;
    }

    @Override
    public int prune() {
        return 0;
    }

    @Override
    public boolean isFull() {
        return false;
    }

    @Override
    public void remove(Object o) {

    }

    @Override
    public void clear() {

    }

    @Override
    public int size() {
        return 0;
    }

    @Override
    public boolean isEmpty() {
        return false;
    }

    @Override
    public boolean containsKey(Object o) {
        return false;
    }

    @Override
    public Iterator iterator() {
        return null;
    }
}
